﻿namespace MyAMS.WebServer.ViewModels
{
    /// <summary>
    /// 部分视图模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ViewModelPartial<T>
    {
        /// <summary>
        /// 初始化一个新的 <see cref="ViewModelPartial&lt;T&gt;"/> 类的实例
        /// </summary>
        /// <param name="rootModel">根视图模型</param>
        /// <param name="partialModel">部分视图模型</param>
        public ViewModelPartial(BaseViewModel rootModel, T partialModel)
        {
            RootModel = rootModel;
            PartialModel = partialModel;
        }

        /// <summary>
        /// 获取或设置根视图模型
        /// </summary>
        public BaseViewModel RootModel { get; set; }

        /// <summary>
        /// 获取或设置部分视图模型
        /// </summary>
        public T PartialModel { get; set; }
    }
}
